// 应用接口
import config from "./config";
import configfabu from "./configfabu";

var domain = config.getDomain;
var h5 = config.getH5;
var DUIXIN_BANNER_ID = config.getDUIXIN_BANNER_ID;
var DUIXIN_CATS_ID = config.getDUIXIN_CATS_ID;
var pageCount = config.getPageCount;
var categoriesID = config.getCategoriesID;
var apileixing = config.getApileixing;

var jiugetu = configfabu.postDUIXIN_JIUGETU_ID;
var DUIXIN_API =  domain + '/index.php?v=1&appid='+config.getAPPID+'&appsecret='+config.getAPPSECRET+'&';

export default  {
	// 应用导航
	getYingyong_daohang(){
		var url = DUIXIN_API + '&s=cloud&c=daohang&m=index';
		return url;
	},
	// 应用首页插件
	getyingyong_xin(){
		var url = DUIXIN_API + '&s=cloud&c=xin&m=index';
		return url;
	},
	// 应用详情
	getyingyong_xiangqing(uid,code){
		var url = DUIXIN_API + '&s=cloud&c=yingyong&m=index';
		if(uid && code){
			url += '&api_auth_uid='+uid+'&api_auth_code='+code;
		}
		return url;
	},
	postGoumai(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=cloud&m=index&c=goumai&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	// 列表
	getYingyong_list(obj) {
		var url = DUIXIN_API + '&s=cloud&c=liebiao&m=index&pagesize=20&page=' + obj.page;
		if (obj.categories != 0) {
		  url += '&catid=' + obj.categories;
		} else if (obj.search != '') {
		  url += '&keyword=' + encodeURIComponent(obj.search);
		}
		// 属性
		if (obj.shuxing != 0) {
		  url += '&shuxingzhi=' + obj.shuxing;
		}
		// 价格
		if (obj.jiage != 0) {
		  url += '&jiage=' + obj.jiage;
		}
		// 版本
		if (obj.banben != 0) {
		  url += '&banben=' + obj.banben;
		}
		// 分类
		if (obj.fenlei != 0) {
		  url += '&fenlei=' + obj.fenlei;
		}
		// 模板分类
		if (obj.mobanfenlei != 0) {
		  url += '&mobanfenlei=' + obj.mobanfenlei;
		}
		// 服务分类
		if (obj.fuwufenlei != 0) {
		  url += '&fuwufenlei=' + obj.fuwufenlei;
		}
		return url;
	},
	getYingyong_fuwu(){
		var url = DUIXIN_API + '&s=cloud&c=liebiao_fuwu&m=index';
		return url;
	},
	//创业金购买
	chuangyejin_goumai(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=cloud&c=chuangyejin&m=index&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},

	
	
	
};